﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProjectFitus.Models;
using System.Web.Mvc;

namespace ProjectFitus.Tests.Controllers
{
	//mock datacontext
	//
    public class MockDBFitusRepository : IDBFitusRepository
    {
        List<Models.NewsContent> m_news = new List<Models.NewsContent>();

        internal void Add(Models.NewsContent n)
        {
            m_news.Add(n);
        }

        void AddNews(NewsContent news)
        {
            m_news.Add(news);

        }

        IEnumerable<NewsContent> GetNewsByCategoryId(int id)
        {
            //TODO á eftir að útfæra, vantar venslatöflu milli greinar og flokks
            IEnumerable<NewsContent> newsCollection = from n in m_news
                                                      select n;
            //where n.id == m_db.
            return newsCollection;
        }

        IEnumerable<NewsContent> GetNews(int count)
        {
            IEnumerable<NewsContent> newsContent = (from nc in m_news
                                                    orderby nc.title ascending
                                                    select nc).Take(count);
            return newsContent;
        }

        IEnumerable<NewsContent> GetAllNews()
        {
            IEnumerable<NewsContent> newsContent = (from nc in m_news
                                                    orderby nc.title ascending
                                                    select nc);
            return newsContent;

        }

        NewsContent GetNewsById(long id)
        {
            NewsContent newsContent = (from nc in m_news
                                       where nc.id == id
                                       select nc).SingleOrDefault();
            return newsContent;
        }

        void UpdateNews(NewsContent editedNews)
        {
            NewsContent currentNews = GetNewsById(editedNews.id);
            if (currentNews != null)
            {
                currentNews.contentText = editedNews.contentText;
                currentNews.lastEditedByUserId = editedNews.lastEditedByUserId;
                currentNews.title = editedNews.title;
                currentNews.lastDateEdited = DateTime.Now;
                currentNews.isActive = editedNews.isActive;
                //m_db.SubmitChanges();
            }
        }


        public SubSite GetSubsiteByTitle(string strTitle)
        {
            throw new NotImplementedException();
        }

        public SubSite GetSubsiteById(int subSiteId)
        {
            throw new NotImplementedException();
        }

        public void IDBFitusRepository.UpdateSubSite(SubSite editedSubSite, int subSiteId)
        {
            throw new NotImplementedException();
        }

        public void addArticle(ArticleContent article)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<ArticleContent> GetAllArticles()
        {
            throw new NotImplementedException();
        }

        public ArticleContent GetArticleById(long id)
        {
            throw new NotImplementedException();
        }

        void IDBFitusRepository.AddNews(NewsContent news)
        {
            throw new NotImplementedException();
        }

        IEnumerable<NewsContent> IDBFitusRepository.GetNewsByCategoryId(int id)
        {
            throw new NotImplementedException();
        }

        IEnumerable<NewsContent> IDBFitusRepository.GetNews(int count)
        {
            throw new NotImplementedException();
        }

        IEnumerable<NewsContent> IDBFitusRepository.GetAllNews()
        {
            throw new NotImplementedException();
        }

        NewsContent IDBFitusRepository.GetNewsById(long id)
        {
            throw new NotImplementedException();
        }

        void IDBFitusRepository.UpdateNews(NewsContent editedNews)
        {
            throw new NotImplementedException();
        }

        public long GetUserIdByAspNetUsrId(Guid aspNetUserId)
        {
            throw new NotImplementedException();
        }

        public User GetUserById(long usrId)
        {
            throw new NotImplementedException();
        }

        public void AddNewUser(string usr, string email)
        {
            throw new NotImplementedException();
        }

        public void UpdateUser(User usr)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<ProfessionListItem> GetAllProfessions()
        {
            throw new NotImplementedException();
        }

        public List<System.Web.Mvc.SelectListItem> GetAllProfessionsViaSelectList()
        {
            throw new NotImplementedException();
        }

        public Specialist GetSpecialistById(long id)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<Specialist> GetAllSpecialists()
        {
            throw new NotImplementedException();
        }

        public void InsertNewSpecialist(Specialist specs)
        {
            throw new NotImplementedException();
        }

        public void UpdateSpecialist(Specialist specs)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<Request> GetAllRequests()
        {
            throw new NotImplementedException();
        }

        public Request GetRequestById(long id)
        {
            throw new NotImplementedException();
        }

        public void CreateRequest(Request req)
        {
            throw new NotImplementedException();
        }

        public void UpdateRequest(Request req)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<Request> Get_n_MostRecentRequestsAtPage_p(int n, int p)
        {
            throw new NotImplementedException();
        }

        public List<System.Web.Mvc.SelectListItem> GetAllStatusNamesViaSelectList()
        {
            throw new NotImplementedException();
        }
        public ArticleContent GetAllArticles(int articleId)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<long> GetAuthorsIdsByArticleId(int articleId)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<string> GetAuthorsStringByArticleId(int articleId)
        {
            throw new NotImplementedException();
        }


        IEnumerable<AssignmentStatusListItem> IDBFitusRepository.GetAllStatusNames()
        {
            throw new NotImplementedException();
        }

        List<SelectListItem> IDBFitusRepository.GetAllStatusNamesViaSelectListItems()
        {
            throw new NotImplementedException();
        }

        IEnumerable<RequestType> IDBFitusRepository.GetAllRequestTypes()
        {
            throw new NotImplementedException();
        }

        List<SelectListItem> IDBFitusRepository.GetAllRequestTypesViaSelectListItems()
        {
            throw new NotImplementedException();
        }

        List<SelectListItem> IDBFitusRepository.GetAllProfessionsViaSelectListItems()
        {
            throw new NotImplementedException();
        }


        public IEnumerable<SelectListItem> GetContentCategoryByParentId(int parentId, int catTypeid)
        {
            throw new NotImplementedException();
        }

        public void SaveChanges()
        {
            throw new NotImplementedException();
        }

        public int GetNewsSelectedCategoryId(long newsId)
        {
            throw new NotImplementedException();
        }

        public NewsToCategory GetNewsToCategoryByIds(long newsId, int categoryId)
        {
            throw new NotImplementedException();
        }

        public void UpdateNewsToCategories(NewsToCategory ntc, int oldCategoryId)
        {
            throw new NotImplementedException();
        }

        IEnumerable<RequestResponse> GetAllActiveRequestResponsesByRequestId(long requestId)
        {
            throw new NotImplementedException();
        }

        IEnumerable<RequestResponse> GetAllRequestResponsesByRequestId(long requestId)
        {
            throw new NotImplementedException();
        }

        void AddRequestResponse(RequestResponse reqresp)
        {
            throw new NotImplementedException();
        }

        void DeReActivateRequestResponse(long responseId)
        {
            throw new NotImplementedException();
        }
    }
}
